#define _CRT_SECURE_NO_WARNINGS 1
#include "dList.h"


void test()
{
	DLNode* List = InitDList();
	ListPushBack(List, 1);
	ListPushBack(List, 2);
	ListPushBack(List, 3);
	ListPushBack(List, 4);

	PrintList(List);

	ListPushFront(List, 0);
	ListPushFront(List, -1);
	ListPushFront(List, -2);
	ListPushFront(List, -3);

	PrintList(List);

	ListPopBack(List);
	ListPopBack(List);
	ListPopBack(List);
	PrintList(List);


	DLNode* pos = FineNode(List, 0);
	if(pos)
		InsertPosNode(pos, 100);
	pos = FineNode(List, 0);
	if (pos)
		InsertPosNode(pos, 200);
	pos = FineNode(List, 0);
	if (pos)
		InsertPosNode(pos, 1000);
	PrintList(List);

	pos = FineNode(List, 0);
	if (pos)
		DeletePosNode(pos);

	pos = FineNode(List, 200);
	if (pos)
		DeletePosNode(pos);

	pos = FineNode(List, 100);
	if (pos)
		DeletePosNode(pos);

	InsertPosNode(List, 1000);

	PrintList(List);


	/*ListPopBack(List);
	ListPopBack(List);
	ListPopBack(List);

	PrintList(List);

	ListPopFront(List);
	ListPopFront(List);
	ListPopFront(List);*/

	Destroy(List);
	List = NULL;
}
int main() {
	test();
	return 0;
}
